package com.esri.core.renderer;

import com.esri.core.internal.util.d;
import java.io.IOException;
import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonNode;

/* loaded from: classes.dex */
public class ClassBreaksDefinition extends ClassificationDefinition {
    public static final float HALF = 0.5f;
    public static final float ONE = 1.0f;
    public static final float QUARTER = 0.25f;
    public static final float THIRD = 0.33f;
    private static final String a = "normalizationField";
    private static final String b = "normalizationType";
    private static final String c = "standardDeviationInterval";
    private static final String d = "breakCount";
    private static final String e = "classificationMethod";
    private static final String f = "classificationField";
    private String g;
    private ClassificationMethod h;
    private int i;
    private float j;
    private String k;
    private NormalizationType l;

    /* loaded from: classes.dex */
    public enum ClassificationMethod {
        NaturalBreaks("esriClassifyNaturalBreaks"),
        EqualInterval("esriClassifyEqualInterval"),
        Quantile("esriClassifyQuantile"),
        StdDeviation("esriClassifyStandardDeviation"),
        GeoInterval("esriClassifyGeometricalInterval");
        
        String a;

        ClassificationMethod(String str) {
            this.a = str;
        }

        public String getValue() {
            return this.a;
        }

        @Override // java.lang.Enum
        public String toString() {
            return this.a;
        }

        public static ClassificationMethod fromString(String str) {
            if ("esriClassifyNaturalBreaks".equals(str)) {
                return NaturalBreaks;
            }
            if ("esriClassifyEqualInterval".equals(str)) {
                return EqualInterval;
            }
            if ("esriClassifyQuantile".equals(str)) {
                return Quantile;
            }
            if ("esriClassifyStandardDeviation".equals(str)) {
                return StdDeviation;
            }
            if ("esriClassifyGeometricalInterval".equals(str)) {
                return GeoInterval;
            }
            return null;
        }
    }

    public static ClassBreaksDefinition createByClassificationMethod(String str, ClassificationMethod classificationMethod, int i) {
        return new ClassBreaksDefinition(str, classificationMethod, i, 1.0f, NormalizationType.None, null);
    }

    public static ClassBreaksDefinition createByStdDeviation(String str, float f2) {
        return new ClassBreaksDefinition(str, ClassificationMethod.StdDeviation, 0, f2, NormalizationType.None, null);
    }

    public static ClassBreaksDefinition createByNormalizationMethod(String str, ClassificationMethod classificationMethod, int i, NormalizationType normalizationType) {
        return new ClassBreaksDefinition(str, classificationMethod, i, 0.5f, normalizationType, null);
    }

    public static ClassBreaksDefinition createWithNormalizeByField(String str, ClassificationMethod classificationMethod, int i, String str2) {
        return new ClassBreaksDefinition(str, classificationMethod, i, 0.5f, NormalizationType.ByField, str2);
    }

    protected ClassBreaksDefinition(String str, ClassificationMethod classificationMethod, int i, float f2, NormalizationType normalizationType, String str2) {
        this.j = 1.0f;
        this.l = NormalizationType.None;
        this.g = str;
        this.h = classificationMethod;
        this.i = i;
        this.j = f2;
        this.l = normalizationType;
        this.k = str2;
        this._type = "classBreaksDef";
    }

    public ClassBreaksDefinition(JsonNode jsonNode) {
        super(jsonNode);
        this.j = 1.0f;
        this.l = NormalizationType.None;
        this.g = d.a(jsonNode, f);
        this.h = ClassificationMethod.fromString(d.a(jsonNode, e));
        this.i = d.a(jsonNode, d, 1);
        this.j = d.a(jsonNode, c, 1.0f);
        this.l = NormalizationType.fromString(d.a(jsonNode, b));
        this.k = d.a(jsonNode, a);
    }

    public void setClassificationField(String str) {
        this.g = str;
    }

    public String getClassificationField() {
        return this.g;
    }

    public void setClassificationMethod(ClassificationMethod classificationMethod) {
        this.h = classificationMethod;
    }

    public ClassificationMethod getClassificationMethod() {
        return this.h;
    }

    public void setBreakCount(int i) {
        this.i = i;
    }

    public int getBreakCount() {
        return this.i;
    }

    public void setStdDevInterval(float f2) {
        this.j = f2;
    }

    public float getStdDevInterval() {
        return this.j;
    }

    public void setNormalizationField(String str) {
        this.k = str;
    }

    public String getNormalizationField() {
        return this.k;
    }

    public void setNormalizationType(NormalizationType normalizationType) {
        this.l = normalizationType;
    }

    public NormalizationType getNormalizationType() {
        return this.l;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // com.esri.core.renderer.ClassificationDefinition
    public void toJson(JsonGenerator jsonGenerator) throws IOException, JsonGenerationException, Exception {
        super.toJson(jsonGenerator);
        jsonGenerator.writeStringField(f, this.g);
        jsonGenerator.writeStringField(e, this.h.getValue());
        jsonGenerator.writeNumberField(d, this.i);
        if (this.h == ClassificationMethod.StdDeviation) {
            jsonGenerator.writeNumberField(c, this.j);
        }
        if (this.l != NormalizationType.None) {
            jsonGenerator.writeStringField(b, this.l.getValue());
        }
        if (this.l == NormalizationType.ByField) {
            jsonGenerator.writeStringField(a, this.k);
        }
    }

    @Override // com.esri.core.renderer.ClassificationDefinition
    public String toString() {
        return "ClassBreaksDefinition [classificationField=" + this.g + ", classificationMethod=" + this.h + ", breakCount=" + this.i + ", stdDevInterval=" + this.j + ", normalizationField=" + this.k + ", normalizationType=" + this.l + "," + super.toString() + "]";
    }
}
